/*
 * matrix.h
 *
 *  Created on: 10 May 2012
 *      Author: hframe
 */

#ifndef MATRIX_H_
#define MATRIX_H_
#include "../common.h"
#include <math.h>

startnamespace(androidplus)startnamespace(drawing)

class matrix {
public:
	matrix();
	virtual ~matrix();
	matrix(const matrix &m);
	matrix(t_float *array,t_uint8 lenght);
	matrix& operator=(const matrix &m);
	t_bool operator==(const matrix &m);
	t_float& operator[]( t_uint32 index);


	/*matrix& operator+(const matrix &m);
	matrix& operator/(const matrix &m);
	matrix& operator*(const matrix &m);
	matrix& operator-(const matrix &m);
	matrix& operator+(t_float val);
	matrix& operator/(t_float val);
	matrix& operator*(t_float val);
	matrix& operator-(t_float val);
	matrix& operator+=(const matrix &m);
	matrix& operator/=(const matrix &m);
	matrix& operator*=(const matrix &m);
	matrix& operator-=(const matrix &m);
	matrix& operator+=(t_float val);
	matrix& operator/=(t_float val);
	matrix& operator*=(t_float val);
	matrix& operator-=(t_float val);*/
	matrix operator*(const matrix &m);
	 t_float *to_float_array();
public:
	matrix& scale(t_float x,t_float y=1,t_float z=1);
	matrix& rotate(t_float angle,t_float x,t_float y=1,t_float z=1);
	matrix& transform(t_float x,t_float y=1,t_float z=1);

public:
	static matrix matrix_identity();
	static t_float length(t_float x,t_float y,t_float z);

private:
	t_float *data;
	t_float *temp;
};

endnamespace(drawing)
endnamespace(androidplus)
#endif /* MATRIX_H_ */
